{extend name="template/base" /}
{block name="content"}
<div class="page-container">
    <div class="cl pd-5 bg-1 bk-gray">
        <span class="l">
            {tp:menu menu='add' title="添加一级分类"/}
            {tp:menu menu='saveOrder' /}
        </span>
    </div>

    <div class="">
        <ul id="Huifold1" class="Huifold">
            {volist name="list" id="vo"}
            <li class="first">
                <h4 class="row">
                    <span class="col-sm-4">{$vo.name}</span>
                    <span class="layer-plane">
                        {tp:menu menu='sedit,sdelete'/}
                        {$vo.status|show_status=$vo.id}
                        {tp:menu menu='sadd' url='add:id=$vo.id' title='添加子类'/}
                    </span>
                    排序：<input type="number" name="sort[{$vo.id}]" value="{$vo.sort}" style="width: 60px;"
                           class="input-text text-c order-input" data-id="{$vo.id}">
                </h4>
                <div class="info" style="border: 2px dashed">
                    <ul>
                        {volist name="vo._child" id="svo"}
                        <li class="second">
                            <h4 class="row">
                                <span class="col-sm-4">{$svo.name}</span><!--└├-->
                                <span class="layer-plane">
                                {tp:menu menu='sedit,sdelete' url='edit:id=$svo.id,delete:id=$svo.id'"/}
                                {$svo.status|show_status=$svo.id}
                                {tp:menu menu='sadd' url='add:id=$svo.id'  title='添加子类'/}
                                </span>
                                排序：<input type="number" name="sort[{$svo.id}]" value="{$svo.sort}" style="width: 60px;"
                                          class="input-text text-c order-input" data-id="{$svo.id}">
                            </h4>
                            <div class="info" style="border: 1px dashed">
                                <table class="table table-border">
                                    {volist name="svo._child" id="tvo"}
                                    <tr>
                                        <td width="3%"></td>
                                        <td width="30%">{$tvo.name}</td>
                                        <td>
                                            {tp:menu menu='sedit,sdelete' url='edit:id=$tvo.id,delete:id=$tvo.id'" /}
                                            {$tvo.status|show_status=$tvo.id}
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            排序：<input type="number" name="sort[{$tvo.id}]" value="{$tvo.sort}" style="width: 60px;"
                                                      class="input-text text-c order-input" data-id="{$tvo.id}">
                                        </td>
                                    </tr>
                                    {/volist}
                                </table>
                            </div>
                        </li>
                        {/volist}
                    </ul>
                </div>
            </li>
            {/volist}
        </ul>
    </div>

</div>
{/block}
{block name='script'}
<link rel="stylesheet" href="__LIB__/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css">

<script>
    $(function(){
        $.Huifold("#Huifold1 .first>h4","#Huifold1 .first>.info","fast",1,"click"); /*5个参数顺序不可打乱，分别是：相应区,隐藏显示的内容,速度,类型,事件*/
        $.Huifold("#Huifold1 .second>h4","#Huifold1>.second .info","fast",3,"click");
    });
    $('.layer-plane').click(function (e) {
        e.stopPropagation();
    });
</script>
{/block}